package field_method66;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

public class Yue {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("xxxx年x月x号xx:xx:xx");

        while (true) {
            LocalDateTime currentTime = LocalDateTime.now();
            System.out.println(currentTime.format(formatter) + ": 循环操作中~~~ 按n退出循环");

            String userInput = scanner.nextLine().trim();

            if (userInput.equalsIgnoreCase("n")) {
                break;
            }
        }

        System.out.println("循环结束！");
        scanner.close();

    }
}
